package com.simpleframe.views.ui;

import javax.servlet.http.HttpServletRequest;

import com.simpleframe.security.User;
import com.simpleframe.views.components.Operate;
import com.simpleframe.views.components.Component;


public class OperateTag extends ComponentTagSupport {
	
	private static final long serialVersionUID = 2074596370942301565L;

	protected String url;
	protected String type;
	protected String title;
	
	public Component getModelBean() {
		return new Operate();
	}
	
	@Override
	protected void populateParameters() {
		super.populateParameters();
		Operate out = (Operate)component;
		out.setUrl(url);
		out.setType(type);
		out.setTitle(title);
		HttpServletRequest request = (HttpServletRequest)pageContext.getRequest();
		out.setUser((User)request.getSession().getAttribute(User.USER_SESSION));
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	public void setType(String type) {
		this.type = type;
	}
	
	public void setTitle(String title) {
		this.title = title;
	}
}
